<!DOCTYPE html>
<html>
<head>
<script src="../../../resources/js-test.js"></script>
</head>
<body>
<p id="description"></p>
<div id="console"></div>
<script>

description("This tests the constructor for the SpeechRecognitionEvent DOM class.");

// Test constructor without initializer.
shouldBe("new webkitSpeechRecognitionEvent('eventType').bubbles", "false");
shouldBe("new webkitSpeechRecognitionEvent('eventType').cancelable", "false");
shouldBe("new webkitSpeechRecognitionEvent('eventType').results", "null");
shouldBe("new webkitSpeechRecognitionEvent('eventType').resultIndex", "0");

// Test passing bubbles in the initializer.
shouldBe("new webkitSpeechRecognitionEvent('eventType', { bubbles: false }).bubbles", "false");
shouldBe("new webkitSpeechRecognitionEvent('eventType', { bubbles: true }).bubbles", "true");

// Test passing cancelable in the initializer.
shouldBe("new webkitSpeechRecognitionEvent('eventType', { cancelable: false }).cancelable", "false");
shouldBe("new webkitSpeechRecognitionEvent('eventType', { cancelable: true }).cancelable", "true");

// Test passing resultIndex in the initializer.
shouldBe("new webkitSpeechRecognitionEvent('eventType', { resultIndex: 42 }).resultIndex", "42");

</script>
</body>
</html>

